import request from '@/config/axios'

// 充值卡 VO
export interface CardVO {
  id: number // 主键
  cardType: string // 卡类单位
  cardValue: number // 卡值
  closure: number // 是否封停
  sellStatus: number // 销售状态
  useStatus: number // 使用状态
  remarks: string // 备注
}

// 充值卡 API
export const CardApi = {
  // 查询充值卡分页
  getCardPage: async (params: any) => {
    return await request.get({ url: `/verify/card/page`, params })
  },

  // 查询充值卡详情
  getCard: async (id: number) => {
    return await request.get({ url: `/verify/card/get?id=` + id })
  },

  // 新增充值卡
  createCard: async (data: CardVO) => {
    return await request.post({ url: `/verify/card/create`, data })
  },

  // 修改充值卡
  updateCard: async (data: CardVO) => {
    return await request.put({ url: `/verify/card/update`, data })
  },

  // 删除充值卡
  deleteCard: async (id: number) => {
    return await request.delete({ url: `/verify/card/delete?id=` + id })
  },

  // 导出充值卡 Excel
  exportCard: async (params) => {
    return await request.download({ url: `/verify/card/export-excel`, params })
  },
}